<?php
namespace Home\Model;

use Think\Model\RelationModel;

class EntryCityModel extends RelationModel
{
    protected $_link = array(
        // 关联城市
        'City' => array(
            'mapping_type'=> self::BELONGS_TO,
            'class_name'=>'City',
            'foreign_key'=>'city_id',
            'mapping_name'=>'city',
            'mapping_fields'=>'name',
            'as_fields' => 'name:city_name',
        ),
    );
}

?>